package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the QUESTION_BANK database table.
 * 
 */
@Entity
@Table(name="QUESTION_BANK")
@NamedQuery(name="QuestionBank.findAll", query="SELECT q FROM QuestionBank q")
public class QuestionBank implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="QUESTION_BANK_QUID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="QUESTION_BANK_QUID_GENERATOR")
	@Column(name="QU_ID")
	private long quId;

	@Column(name="COMPOSITE_NUMBER")
	private BigDecimal compositeNumber;

	@Column(name="NUMBER_JUDGE")
	private BigDecimal numberJudge;

	@Column(name="NUMBER_MULTIPLE")
	private BigDecimal numberMultiple;

	@Column(name="NUMBER_RADIO")
	private BigDecimal numberRadio;

	@Column(name="QU_BLOCKUP")
	private String quBlockup;

	@Column(name="QU_DATE")
	private Timestamp quDate;

	@Column(name="QU_NAME")
	private String quName;

	@Column(name="QU_PERSON")
	private String quPerson;

	@Column(name="QU_REMARK")
	private String quRemark;

	@Column(name="QU_TIANKONG")
	private BigDecimal quTiankong;

	//bi-directional many-to-one association to ExamPaper
	@OneToMany(mappedBy="questionBank")
	@JSONField(serialize=false)
	private List<ExamPaper> examPapers;

	//bi-directional many-to-one association to Mistake
	@OneToMany(mappedBy="questionBank")
	@JSONField(serialize=false)
	private List<Mistake> mistakes;

	//bi-directional many-to-one association to DefinitionDept
	@ManyToOne
	@JoinColumn(name="DEFIDE_ID")
	private DefinitionDept definitionDept;

	//bi-directional many-to-one association to QuestionType
	@OneToMany(mappedBy="questionBank")
	@JSONField(serialize=false)
	private List<QuestionType> questionTypes;

	public QuestionBank() {
	}

	public long getQuId() {
		return this.quId;
	}

	public void setQuId(long quId) {
		this.quId = quId;
	}

	public BigDecimal getCompositeNumber() {
		return this.compositeNumber;
	}

	public void setCompositeNumber(BigDecimal compositeNumber) {
		this.compositeNumber = compositeNumber;
	}

	public BigDecimal getNumberJudge() {
		return this.numberJudge;
	}

	public void setNumberJudge(BigDecimal numberJudge) {
		this.numberJudge = numberJudge;
	}

	public BigDecimal getNumberMultiple() {
		return this.numberMultiple;
	}

	public void setNumberMultiple(BigDecimal numberMultiple) {
		this.numberMultiple = numberMultiple;
	}

	public BigDecimal getNumberRadio() {
		return this.numberRadio;
	}

	public void setNumberRadio(BigDecimal numberRadio) {
		this.numberRadio = numberRadio;
	}

	public String getQuBlockup() {
		return this.quBlockup;
	}

	public void setQuBlockup(String quBlockup) {
		this.quBlockup = quBlockup;
	}

	public Timestamp getQuDate() {
		return this.quDate;
	}

	public void setQuDate(Timestamp quDate) {
		this.quDate = quDate;
	}

	public String getQuName() {
		return this.quName;
	}

	public void setQuName(String quName) {
		this.quName = quName;
	}

	public String getQuPerson() {
		return this.quPerson;
	}

	public void setQuPerson(String quPerson) {
		this.quPerson = quPerson;
	}

	public String getQuRemark() {
		return this.quRemark;
	}

	public void setQuRemark(String quRemark) {
		this.quRemark = quRemark;
	}

	public BigDecimal getQuTiankong() {
		return this.quTiankong;
	}

	public void setQuTiankong(BigDecimal quTiankong) {
		this.quTiankong = quTiankong;
	}

	public List<ExamPaper> getExamPapers() {
		return this.examPapers;
	}

	public void setExamPapers(List<ExamPaper> examPapers) {
		this.examPapers = examPapers;
	}

	public ExamPaper addExamPaper(ExamPaper examPaper) {
		getExamPapers().add(examPaper);
		examPaper.setQuestionBank(this);

		return examPaper;
	}

	public ExamPaper removeExamPaper(ExamPaper examPaper) {
		getExamPapers().remove(examPaper);
		examPaper.setQuestionBank(null);

		return examPaper;
	}

	public List<Mistake> getMistakes() {
		return this.mistakes;
	}

	public void setMistakes(List<Mistake> mistakes) {
		this.mistakes = mistakes;
	}

	public Mistake addMistake(Mistake mistake) {
		getMistakes().add(mistake);
		mistake.setQuestionBank(this);

		return mistake;
	}

	public Mistake removeMistake(Mistake mistake) {
		getMistakes().remove(mistake);
		mistake.setQuestionBank(null);

		return mistake;
	}

	public DefinitionDept getDefinitionDept() {
		return this.definitionDept;
	}

	public void setDefinitionDept(DefinitionDept definitionDept) {
		this.definitionDept = definitionDept;
	}

	public List<QuestionType> getQuestionTypes() {
		return this.questionTypes;
	}

	public void setQuestionTypes(List<QuestionType> questionTypes) {
		this.questionTypes = questionTypes;
	}

	public QuestionType addQuestionType(QuestionType questionType) {
		getQuestionTypes().add(questionType);
		questionType.setQuestionBank(this);

		return questionType;
	}

	public QuestionType removeQuestionType(QuestionType questionType) {
		getQuestionTypes().remove(questionType);
		questionType.setQuestionBank(null);

		return questionType;
	}

}